home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d918.lha / MultiPlot / Rexx / Scripts / readtable.mpt < prev    next >
Text File  |  1993-10-04  |  1KB  |  58 lines

  1. /* This script should be started from the TOOL TYPES
  2. STARTUP script option. It allows the input of tabulated
  3. data in which columns represent multiple data sets */
  4.  
  5.  
  6. port= 'MULTIPLOT.01'
  7. RESULT=''
  8. RC=0
  9.  
  10. /* Check Multiplot is running */
  11. options results
  12. if(~show('p',port)) then do
  13.   say "Please start Multiplot first"
  14.   exit 1
  15. end
  16. address value port
  17.  
  18. /* Check a DATA SELECTION WINDOW is active */
  19. 'QUERY'
  20. if(rc ~=0) then do
  21.   say "QUERY command failed!"
  22.   exit 1
  23. end
  24. if(compare('DATSEL',RESULT)<6) then do
  25.   'SAY Please run script from TOOL TYPES.'
  26.   exit 1
  27. end
  28.  
  29. /* Load filename and column numbers */
  30. 'REQ'
  31. 'PULL Enter column number for X.'
  32. Xcolno=RESULT
  33. 'PULL Enter number for first Y column.'
  34. Y1colno=RESULT
  35. 'PULL Enter number for last Y column.'
  36. Y2colno=RESULT
  37.  
  38. insert('COLUMN ',insert(Xcolno, " XCOL"))
  39.  
  40. /* Load each column of Y data */
  41. do i=Y1colno to Y2colno
  42.   insert('COLUMN ',insert(i, " YCOL"))
  43.   'CONTINUE'
  44.   'QUERY'
  45.   if(rc ~=0) then do
  46.     say "QUERY command failed!"
  47.     exit 1
  48.   end
  49.   if(compare('PLOWIN',RESULT)<6) then do
  50.     'SAY ERROR: Script terminating.'
  51.     'STOP'
  52.     exit 1
  53.   end
  54.   'ADDFILE'
  55. end
  56. 'STOP'
  57.  
  58.